import 'package:flutter/material.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBColor/YBColor.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBImageStyle/YBImageStyle.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBModule/YBLoginModule/YBLoginMainPage/YBLoginProvider/YBEventBus.dart';

class YBLoginSubPage extends StatefulWidget {
  @override
  _YBLoginSubPageState createState() => _YBLoginSubPageState();
}

class _YBLoginSubPageState extends State<YBLoginSubPage> {

  TextEditingController _editingController = TextEditingController();


  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    _editingController.addListener(() {
      eventBus.fire(YBPhoneEventBus(_editingController.text));
    });
  }

  @override
  void dispose() {
    // TODO: implement dispose
    _editingController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      height: 50,
      child:Column(
        children: [
          Expanded(
            child: TextField(
              decoration: InputDecoration(
                icon: Image.asset(YBImageStyle.getImagePath('login_phone')),
                hintText:'请输入手机号码',
                border: InputBorder.none,
                contentPadding: EdgeInsets.all(0),
              ),
              controller: _editingController,
            ),
          ),
          Container(
            color: YBColor.homeBorderLineColor,
            height: 1,
          ),
        ],
      ),
    );
  }
}

